using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace Slqj.Data
{
	public static class TableGROrderItemPrice
	{
		public const string Table = "GROrderItemPrice";
		public const string GROrderItemPriceID = "GROrderItemPriceID";
		public const string GuestRoomOrderItemID = "GuestRoomOrderItemID";
		public const string OrderDate = "OrderDate";
		public const string SettlementPrice = "SettlementPrice";
		public const string OriginalPrice = "OriginalPrice";
		public const string HotelAmount = "HotelAmount";
	}
	
	[Serializable]
	public class BaseGROrderItemPrice
		: IDbSessionEntity, IJsonClass
	{
		int m_GROrderItemPriceID;
		/// <summary>
        /// 客户结算价表ID
        /// </summary>
        public int GROrderItemPriceID
        {
            get { return m_GROrderItemPriceID; }
            set { m_GROrderItemPriceID = value; }
        }
		
		int? m_GuestRoomOrderItemID;
		/// <summary>
        /// 客户订单项表ID
        /// </summary>
        public int? GuestRoomOrderItemID
        {
            get { return m_GuestRoomOrderItemID; }
            set { m_GuestRoomOrderItemID = value; }
        }
		
		DateTime m_OrderDate;
		/// <summary>
        /// 预订日期
        /// </summary>
        public DateTime OrderDate
        {
            get { return m_OrderDate; }
            set { m_OrderDate = value; }
        }
		
		double m_SettlementPrice;
		/// <summary>
        /// 结算价
        /// </summary>
        public double SettlementPrice
        {
            get { return m_SettlementPrice; }
            set { m_SettlementPrice = value; }
        }
		
		double m_OriginalPrice;
		/// <summary>
        /// 
        /// </summary>
        public double OriginalPrice
        {
            get { return m_OriginalPrice; }
            set { m_OriginalPrice = value; }
        }
		
		double m_HotelAmount;
		/// <summary>
        /// 
        /// </summary>
        public double HotelAmount
        {
            get { return m_HotelAmount; }
            set { m_HotelAmount = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_GROrderItemPriceID = reader[TableGROrderItemPrice.GROrderItemPriceID];
            m_GuestRoomOrderItemID = reader[TableGROrderItemPrice.GuestRoomOrderItemID];
            m_OrderDate = reader[TableGROrderItemPrice.OrderDate];
            m_SettlementPrice = reader[TableGROrderItemPrice.SettlementPrice];
            m_OriginalPrice = reader[TableGROrderItemPrice.OriginalPrice];
            m_HotelAmount = reader[TableGROrderItemPrice.HotelAmount];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableGROrderItemPrice.GROrderItemPriceID, PrimaryKeyType.Identity, GROrderItemPriceID);
			writer[TableGROrderItemPrice.GuestRoomOrderItemID] = GuestRoomOrderItemID;
			writer[TableGROrderItemPrice.OrderDate] = OrderDate;
			writer[TableGROrderItemPrice.SettlementPrice] = SettlementPrice;
			writer[TableGROrderItemPrice.OriginalPrice] = OriginalPrice;
			writer[TableGROrderItemPrice.HotelAmount] = HotelAmount;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_GROrderItemPriceID = idd;
        }
		
		public string TableName
        {
            get { return TableGROrderItemPrice.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_GROrderItemPriceID = hashToRead["GROrderItemPriceID"];
			 
             m_GuestRoomOrderItemID = hashToRead["GuestRoomOrderItemID"];
			 
             m_OrderDate = hashToRead["OrderDate"];
			 
             m_SettlementPrice = hashToRead["SettlementPrice"];
			 
             m_OriginalPrice = hashToRead["OriginalPrice"];
			 
             m_HotelAmount = hashToRead["HotelAmount"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["GROrderItemPriceID"] = GROrderItemPriceID;
			 
            hashToFill["GuestRoomOrderItemID"] = GuestRoomOrderItemID;
			 
            hashToFill["OrderDate"] = OrderDate;
			 
            hashToFill["SettlementPrice"] = SettlementPrice;
			 
            hashToFill["OriginalPrice"] = OriginalPrice;
			 
            hashToFill["HotelAmount"] = HotelAmount;
			 
        }

        #endregion
		
	}
}
